﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

using Cards.GUI;
using Cards.Objects;
using Cards.Util;

namespace Cards.Objects
{
    public class CPlayer
    {
        protected String m_name;
        protected long m_money;
        protected int m_winpos;         //tới thứ mấy
        protected Boolean m_notmove;     //xét trường hợp thua trắng
        protected Boolean m_skip;        //bỏ qua không theo một nước đi
        protected INS_Player m_insPlayer;
        protected long m_winmoney;
        protected long m_moneyAdd;
        protected long m_moneySubtract;
        protected String m_noteToAdd;
        protected String m_noteToSubtract;
        protected Boolean m_win;
        
        public Boolean WIN
        {
            get { return m_win; }
            set { m_win = value; }
        }
        public long WINMONEY
        {
            get { return m_winmoney; }
            set { m_winmoney = value; }
        }
        public long AMOUNT_INCREASE_MONEY
        {
            get { return m_moneyAdd; }
            set { m_moneyAdd = value; }
        }
        public long AMOUNT_DECREASE_MONEY
        {
            get { return m_moneySubtract; }
            set { m_moneySubtract = value; }
        }
        public String NOTETOADD
        {
            get { return m_noteToAdd; }
            set { m_noteToAdd = value; }
        }
        public String NOTETOSUBTRACT
        {
            get { return m_noteToSubtract; }
            set { m_noteToSubtract = value; }
        }
        public long MONEY
        {
            get { return m_money; }
            set { m_money = value; }
        }
        public String NAME{
            get { return m_name; }
            set { m_name = value; }
        }
        public int WINPOS
        {
            get { return m_winpos; }
            set { m_winpos = value; }
        }
        public Boolean NOTMOVE
        {
            get { return m_notmove; }
            set { m_notmove = value; }
        }
        public Boolean SKIP
        {
            get { return m_skip; }
            set { m_skip = value; }
        }
        public INS_Player IP
        {
            get { return m_insPlayer; }
            set { m_insPlayer = value; }
        }

        public CPlayer(String _name, INS_Player _insPlayer)
        {
            InitVariable();
            m_name = _name;
            m_insPlayer = _insPlayer;
        }

        public void InitVariable()
        {
            m_winmoney = 0;
            m_money = Constants.ORIGINAL_MONEY;
            //m_trangthai = 0;
            m_winpos = 0;
            m_notmove = true;
            m_skip = false;
        }

        public void AddMoney()
        {
            m_money += (m_moneyAdd - m_moneySubtract + m_winmoney);
        }

        public virtual void CalculateMoney(long amount)
        {
        }
    }    
}
